package de.esk.fraunhofer.ECM_DatenbankOperation.Update;

import de.esk.fraunhofer.XmlStr;
import de.esk.fraunhofer.XMLAnalyser.XML_LadevorgaengerConfigItem;

public class LVConfigUpdate {
	
	private XML_LadevorgaengerConfigItem xml_lci; 
	
	private StringBuffer a=new StringBuffer(XmlStr.lvcu);
	
	public LVConfigUpdate(XML_LadevorgaengerConfigItem xml_lci){
		
		this.xml_lci=xml_lci;
	
	}
	
	@Override
	public String toString(){
		
		a.	 append(XmlStr.BEGIN_XML_TAG_SOC_LIMIT_DCH_MIN)
				.append(xml_lci.SoC_limit_dch_min)
			.append(XmlStr.END_XML_TAG_SOC_LIMIT_DCH_MIN)
			 
			.append(XmlStr.BEGIN_XML_TAG_TARIF_ID)
				.append(xml_lci.tarif_ID)
			.append(XmlStr.END_XML_TAG_TARIF_ID)
			  
			.append(XmlStr.BEGIN_XML_TAG_MINIMAL_DCH_ENERGY_PRICE)
				.append(xml_lci.minimal_dch_energy_price)
			.append(XmlStr.END_XML_TAG_MINIMAL_DCH_ENERGY_PRICE)
			 
			.append(XmlStr.BEGIN_XML_TAG_BATTERY_MODUS)
				.append(xml_lci.battery_modus)
			.append(XmlStr.END_XML_TAG_BATTERY_MODUS)
			
			.append(XmlStr.BEGIN_XML_TAG_SIMPLE_AC_P_CH_MAX)
				.append(xml_lci.Simple_AC_P_ch_max)
			.append(XmlStr.END_XML_TAG_SIMPLE_AC_P_CH_MAX)
			
			.append(XmlStr.BEGIN_XML_TAG_INTELLIGENT_AC_DCH_ENABLE)
				.append(xml_lci.intelligent_AC_dch_enable)
			.append(XmlStr.END_XML_TAG_INTELLIGENT_AC_DCH_ENABLE)
			
			.append(XmlStr.BEGIN_XML_TAG_INTELLIGENT_AC_ENABLE_EXT_CONTROL)
				.append(xml_lci.intelligent_AC_enable_ext_control)
			.append(XmlStr.END_XML_TAG_INTELLIGENT_AC_ENABLE_EXT_CONTROL)
			
			.append(XmlStr.BEGIN_XML_TAG_INTELLIGENT_AC_ENABLE_CONTROL_TABLE)
				.append(xml_lci.intelligent_AC_enable_control_table)
			.append(XmlStr.END_XML_TAG_INTELLIGENT_AC_ENABLE_CONTROL_TABLE)
			  
			.append(XmlStr.BEGIN_XML_TAG_DC_DCH_ENABLE)
				.append(xml_lci.DC_dch_enable)
			.append(XmlStr.END_XML_TAG_DC_DCH_ENABLE)
			  
			.append(XmlStr.BEGIN_XML_TAG_DC_ENABLE_EXT_CONTROL)
				.append(xml_lci.DC_enable_ext_control)
			.append(XmlStr.END_XML_TAG_DC_ENABLE_EXT_CONTROL)
			  
			.append(XmlStr.BEGIN_XML_TAG_DC_ENABLE_CONTROL_TABLE)
				.append(xml_lci.DC_enable_control_table)
			.append(XmlStr.END_XML_TAG_DC_ENABLE_CONTROL_TABLE) 
		  
		.append(XmlStr.END_UPDATE);
		
		return new StringBuilder(XmlStr.root)
			.append(a)
			.append(XmlStr.end)
			.toString();
	}
}
